//
//  HttpDownloader.h
//  Invaders
//
//  Created by Chris Greening on 06/07/2009.
//  Copyright 2009 CMG Research. All rights reserved.
//

#import <Foundation/Foundation.h>

@class HttpDownloader;

@protocol HttpDownloaderDelegate<NSObject>

@optional -(void) downloader:(HttpDownloader *) downloader downloadedData:(NSData *) data;
@optional -(void) downloaderFailed:(HttpDownloader *) downloader;

@end


@interface HttpDownloader : NSObject {
	id delegate;
	NSMutableData *resultData;
	NSURLConnection *theConnection;
}

@property(assign, nonatomic) id delegate;

-(void) downloadDataFromUrl:(NSString *) urlString delegate:(id) theDelegate;
-(void) cancelDownload;
+(NSString *) escapeChars:(NSString *)theString;

@end
